#!/usr/bin/env python

PACKAGE = 'vswarm'
LEVEL = 0

from dynamic_reconfigure.parameter_generator_catkin import ParameterGenerator
from dynamic_reconfigure.parameter_generator_catkin import double_t, bool_t, int_t

gen = ParameterGenerator()

# Low-pass filter
gen.add(name='smoothing_factor', paramtype=double_t, level=LEVEL,
        description='Low-pass filter smoothing factor',
        default=1.0, min=0.0, max=1.0)

# Reynolds gains
gen.add(name='command_gain', paramtype=double_t, level=LEVEL,
        description='Overall gain for flocking command [m/s]',
        default=1.0, min=0.0, max=1.0)
gen.add(name='separation_gain', paramtype=double_t, level=LEVEL,
        description='Reynolds separation gain [m/s]',
        default=7.0, min=0.0, max=100.0)
gen.add(name='cohesion_gain', paramtype=double_t, level=LEVEL,
        description='Reynolds cohesion gain [m/s]',
        default=1.0, min=0.0, max=100.0)
gen.add(name='alignment_gain', paramtype=double_t, level=LEVEL,
        description='Reynolds alignment gain [m/s]',
        default=0.0, min=0.0, max=100.0)
gen.add(name='migration_gain', paramtype=double_t, level=LEVEL,
        description='Reynolds migration gain [m/s]',
        default=1.0, min=0.0, max=100.0)

gen.add(name='perception_radius', paramtype=double_t, level=LEVEL,
        description='Spherical flocking perception radius [m]',
        default=10.0, min=0.0, max=100.0)
gen.add(name='max_agents', paramtype=int_t, level=LEVEL,
        description='Maximum number of other agents perceived',
        default=100, min=0, max=100)

gen.add(name='max_speed', paramtype=double_t, level=LEVEL,
        description='Maximum allowed flocking speed [m/s]',
        default=0.5, min=0.0, max=10.0)

gen.add(name='use_vision', paramtype=bool_t, level=LEVEL,
        description='If true, flock using visual detections [bool]',
        default=True)

gen.add(name='use_altitude', paramtype=bool_t, level=LEVEL,
        description='If true, flock with setpoint altitude [bool]',
        default=True)
gen.add(name='altitude_setpoint', paramtype=double_t, level=LEVEL,
        description='Altitude for flocking [m]',
        default=2.5, min=-50.0, max=50.0)
gen.add(name='altitude_gain', paramtype=double_t, level=LEVEL,
        description='Altitude control gain [m/s]',
        default=0.5, min=0.0, max=10.0)

exit(gen.generate(PACKAGE, 'flocking_node', 'FlockingNode'))
